<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script src="./Node.js"></script>
<script src="./ArrayList.js"></script>

<script>

  // 1. 创建链表的实例
  let list = new ArrayList(); // 初始化一个空链表 头结点
  list.insert(10);
  list.insert(11);
  list.insert(12);
  list.insert(13);
  list.insert(14);
  list.insert(15);
  list.insert(118, 2);
  list.insert(120);
  list.update(1010, 0);
  list.deleteByIndex(0);
  list.deleteByIndex(0);
  console.log(list.toArray());
  list._head = 10;
  console.log(list.toString());


  // let element = list.find(5);
  // console.log(element);

  /*双向链表  prev  val  next*/
  /*修改 : prev-->上一项*/


</script>
</body>
</html>
